//
//  CSSlideCardView.h
//  ChinaShip
//
//  Created by Yale on 2019/1/24.
//  Copyright © 2019年 ChinaShip. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, CardMoveDirection) {
    CardMoveDirectionNone,
    CardMoveDirectionLeft,
    CardMoveDirectionRight
};

//数据源
@protocol CSCardScrollViewDataSource <NSObject>

- (NSInteger)numberOfCards;
- (UIView *)cardReuseView:(UIView *)reuseView atIndex:(NSInteger)index;

@optional
- (void)deleteCardWithIndex:(NSInteger)index;
@end

//修改样式
@protocol CSCardScrollViewDelegate <NSObject>

- (void)updateCard:(UIView *)card withProgress:(CGFloat)progress direction:(CardMoveDirection)direction;

@end


@interface CSSlideCardView : UIView

@property (nonatomic, weak) id <CSCardScrollViewDelegate>cardDelegate;
@property (nonatomic, weak) id <CSCardScrollViewDataSource>cardDataSource;
@property (nonatomic, assign) BOOL canDeleteCard;

- (void)loadCard;
- (NSArray *)allCards;
- (NSInteger)currentCard;

@end
